//
//  GasMoneyVC.m
//  NtoccDriverNew
//
//  Created by niyongsheng on 2022/10/18.
//  Copyright © 2022 GCY. All rights reserved.
//

#import "GasMoneyVC.h"
#import "GasQrVC.h"
#import "GasStationDriverManager.h"

@interface GasMoneyVC ()
@property (weak, nonatomic) IBOutlet UILabel *balanceL;
@property (weak, nonatomic) IBOutlet UITextField *gasMoneyTF;

@property (weak, nonatomic) IBOutlet UIButton *confirmBtn;

@end

@implementation GasMoneyVC

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.tabBarController.navigationItem.title = @"加油";
    self.tabBarController.navigationItem.rightBarButtonItem = nil;
    
    @weakify(self)
    [GSDManager refreshUserInfo:^(GasStationDriverModel *userInfo) {
        @strongify(self)
        self.balanceL.text = [NSString stringWithFormat:@"%@", [userInfo.oilCard isNotBlank] ? userInfo.oilCard : @"0.00"];
    }];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"加油";
    
    ViewRadius(_confirmBtn, 5)
}

- (IBAction)confirmBtnOnclicked:(UIButton *)sender {
    if (![_gasMoneyTF.text isNotBlank]) {
        [XSInfoView showInfo:@"请输入加油金额" onView:self.view];
        return;
    }
    
    GasQrVC *vc = [GasQrVC new];
    vc.money = _gasMoneyTF.text;
    [self.navigationController pushViewController:vc animated:YES];
}

@end
